﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogLibrary
{
    public class LogEvent
    {
        public const string CATEGORY_ERROR = "ERROR";
        public const string CATEGORY_STATUS = "STATUS";
        public const string CATEGORY_ACTION = "ACTION";
        public const string CATEGORY_DETAIL = "DETAIL";

        private DateTime logTime;
        private string logCategory;
        private string logDetail;

        public LogEvent(string Category, string Detail)
        {
            logTime = DateTime.Now;
            logCategory = Category;
            logDetail = Detail;
        }
        

        #region Public Methods

        public void WriteToFile(System.IO.StreamWriter writer)
        {
            writer.Write(logTime.ToString("yyyy-MM-dd HH:mm:ss"));
            writer.Write(": ");
            writer.Write(logCategory);
            writer.Write(", ");
            writer.WriteLine(logDetail);
        }

        #endregion
    }
}
